// TSGDoc.h : interface of the CTSGDoc class
//


#pragma once
#include "mpegts.h"
#include "DVBRule.h"


class CTSGDoc : public CDocument
{
protected: // create from serialization only
	CTSGDoc();
	DECLARE_DYNCREATE(CTSGDoc)

// Attributes
public:

// Operations
public:
	CTSGConfig* GetConfig(void);
	BOOL AnalyzeStream(void);
	UINT GetProgress(void);
	UINT GetDVBTableCount(void);
	char* GetDVBTableName(UINT nIndex);
	BOOL ParseDVBTable(UINT nIndex, BYTE* pData, char* pLine, BYTE& bPosition);
	BOOL AddNewTable(DWORD_PTR pTable);
	INT GetTableIndex(BYTE table_id);
	BOOL RebuildXML(void);
	BYTE* GetSectionBuffer(SHORT pid, BYTE table_id, USHORT parameter, BYTE version, BYTE section_number);
// Overrides
public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);

// Implementation
public:
	virtual ~CTSGDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()

private:
	CTSGConfig m_config;
	UINT m_progress;
	CTSStatistic m_TSStatistic;
	CDVBRule* m_hRules;
};


